package yue.shen.android.demo

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.lifecycleScope
import kotlinx.coroutines.MainScope
import kotlinx.coroutines.cancel
import kotlinx.coroutines.launch
import yue.shen.android.demo.databinding.ActivityCoroutiesScope2Binding

class CoroutineScopeActivity2 : AppCompatActivity() {

    private val scope = MainScope()

    private lateinit var viewBinding: ActivityCoroutiesScope2Binding

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        viewBinding = ActivityCoroutiesScope2Binding.inflate(layoutInflater)
        setContentView(viewBinding.root)
        initData()
    }


    private fun initData(){
        lifecycleScope.launch {

        }
    }


    override fun onDestroy() {
        scope.cancel()
        super.onDestroy()
    }

}